
const Fly = require("./flyio")
const http = new Fly

// 接口请求的域名地址
http.config.baseURL = "https://genapi.yunzhongyou.cc/qqqy/api"

// 添加请求拦截器
http.interceptors.request.use((request: any) => {
  // 给所有请求添加自定义header，带上token信息让服务器验证用户登陆let token = uni.getStorageSync('aliToken');request.headers['Authorization'] = token;// 在当前页面显示导航条加载动画uni.showNavigationBarLoading();return request;  
  // request.headers['token'] = 'flyio';
  return request
})

// 添加响应拦截器，响应拦截器会在then/catch处理之前执行
http.interceptors.response.use((response: any, promise: any) => {
  return promise.resolve(response.data);
})

export default http